#include "HttpClient.h"

HttpClient::HttpClient()
{
    CURLcode ret = curl_global_init(CURL_GLOBAL_ALL);
    if(ret != CURLE_OK)
        printf("curl_global_init fail, %s\n", curl_easy_strerror(ret));
    mInit = true;
}

HttpClient::~HttpClient()
{
    
}

HttpClient* HttpClient::GetInstance()
{
    static HttpClient* pInstance = new HttpClient();
    return pInstance;
}

void HttpClient::Destory()
{
    if(mInit)
        curl_global_cleanup();
    mInit = false;
}